﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EventLogger.DataLayer;

namespace EventLogger.Web.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        private EventLoggerEntities entites = new EventLoggerEntities();

        public ActionResult Index()
        {
            ViewData["events"] = entites.EventDefinitions;
            ViewData["users"] = entites.Events.Select(e => e.UserName).Distinct();
            ViewData["computers"] = entites.Events.Select(e => e.MachineName).Distinct();

            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
